package com.ChainBizPro.system.service.impl;

import com.ChainBizPro.system.common.ErrorCode;
import com.ChainBizPro.system.exception.BusinessException;
import com.ChainBizPro.system.mapper.SupplierratingsMapper;
import com.ChainBizPro.system.model.domain.Supplierratings;
import com.ChainBizPro.system.model.dto.supplierratings.SupplierratingsQueryRequest;
import com.ChainBizPro.system.model.vo.PurchaseOrderVO;
import com.ChainBizPro.system.model.vo.SupplierratingsVO;
import com.ChainBizPro.system.service.SupplierratingsService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author liusijia
* @description 针对表【SupplierRatings(供应商评分)】的数据库操作Service实现
* @createDate 2024-12-16 20:17:05
*/
@Service
public class SupplierratingsServiceImpl extends ServiceImpl<SupplierratingsMapper, Supplierratings>
    implements SupplierratingsService {
    
    @Resource
    private SupplierratingsMapper supplierratingsMapper;

    @Override
    public Page<SupplierratingsVO> getQueryWrapperByAll(Page<SupplierratingsVO> pageParam, SupplierratingsQueryRequest supplierratingsQueryRequest) {
        // 自定义分页查询
        List<SupplierratingsVO> supplierratingsVOS = supplierratingsMapper.getQueryWrapperByAll(pageParam, supplierratingsQueryRequest);
        if (supplierratingsVOS == null) {
            throw new BusinessException(ErrorCode.SYSTEM_ERROR, "查询失败");
        }
        // 设置分页结果
        pageParam.setRecords(supplierratingsVOS);
        return pageParam;
    }
}




